﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

#nullable disable

namespace T4.Console.Db.Models
{
    [Table("Blog_PersonLabel")]
    [Index(nameof(UserId), nameof(Name), Name = "AK_KEY_2_Blog_PersonLabel", IsUnique = true)]
    [Index(nameof(UserId), Name = "Index_1")]
    public partial class Blog_PersonLabel
    {
        public Blog_PersonLabel()
        {
            Blog_PersonLabel_Maps = new HashSet<Blog_PersonLabel_Map>();
        }

        [Key]
        [StringLength(36)]
        public string Id { get; set; }
        [Required]
        [StringLength(36)]
        public string UserId { get; set; }
        [Required]
        [StringLength(50)]
        public string Name { get; set; }
        [StringLength(36)]
        public string CreatedBy { get; set; }
        [Column(TypeName = "datetime")]
        public DateTime? CreatedTime { get; set; }
        [StringLength(36)]
        public string LastModifiedBy { get; set; }
        [Column(TypeName = "datetime")]
        public DateTime? LastModifiedTime { get; set; }

        [ForeignKey(nameof(UserId))]
        [InverseProperty(nameof(Sys_User.Blog_PersonLabels))]
        public virtual Sys_User User { get; set; }
        [InverseProperty(nameof(Blog_PersonLabel_Map.PersonLabel))]
        public virtual ICollection<Blog_PersonLabel_Map> Blog_PersonLabel_Maps { get; set; }
    }
}
